﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using DAL;

namespace BUL
{
    public class KhachhangBUL
    {

        public DataTable DanhsachKH()
        {
            KhachhangDAL kh = new KhachhangDAL();
            DataTable tb = new DataTable();
            tb = kh.DanhsachKH();
            return tb;
        }

        public string MaKH()
        {
            string so;
            string ma = "";
            string left = "";
            KhachhangDAL kh = new KhachhangDAL();
            ma = kh.LayMaKH();
            int s = Convert.ToInt32(ma.Substring(ma.Length - 5));
            s = s + 1;
            left = ma.Substring(0, ma.Length-s.ToString().Length);
            return left + s.ToString();
        }
        public Boolean ThemKhachHang(string sql) {
            KhachhangDAL kh = new KhachhangDAL();
            return kh.ThemKH(sql);
        }
        public Boolean XoaKH(string sql)
        {
            KhachhangDAL kh = new KhachhangDAL();
            return kh.ThemKH(sql);
        }
    }
}
